.class public Lcom/instagram/creation/video/mediarecorder/u;
.super Ljava/lang/Object;
.source "StreamPacketWriter.java"


# instance fields
.field private a:Lcom/instagram/creation/video/mediarecorder/m;

.field private b:Ljava/util/concurrent/LinkedBlockingQueue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/LinkedBlockingQueue",
            "<",
            "Lcom/instagram/creation/video/mediarecorder/a;",
            ">;"
        }
    .end annotation
.end field

.field private c:Lcom/instagram/creation/video/mediarecorder/a;

.field private d:[B

.field private e:I


# direct methods
.method public constructor <init>(Lcom/instagram/creation/video/mediarecorder/m;[BI)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 20
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 21
    iput-object p1, p0, Lcom/instagram/creation/video/mediarecorder/u;->a:Lcom/instagram/creation/video/mediarecorder/m;

    .line 22
    iput-object p2, p0, Lcom/instagram/creation/video/mediarecorder/u;->d:[B

    .line 23
    iput p3, p0, Lcom/instagram/creation/video/mediarecorder/u;->e:I

    .line 25
    new-instance v0, Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-direct {v0}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V

    iput-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->b:Ljava/util/concurrent/LinkedBlockingQueue;

    .line 27
    new-instance v0, Lcom/instagram/creation/video/mediarecorder/a;

    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->d:[B

    iget v2, p0, Lcom/instagram/creation/video/mediarecorder/u;->e:I

    invoke-direct {v0, v1, v2}, Lcom/instagram/creation/video/mediarecorder/a;-><init>([BI)V

    .line 28
    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->b:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v1, v0}, Ljava/util/concurrent/LinkedBlockingQueue;->add(Ljava/lang/Object;)Z

    .line 29
    new-instance v0, Lcom/instagram/creation/video/mediarecorder/a;

    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->d:[B

    iget v2, p0, Lcom/instagram/creation/video/mediarecorder/u;->e:I

    invoke-direct {v0, v1, v2}, Lcom/instagram/creation/video/mediarecorder/a;-><init>([BI)V

    iput-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    .line 30
    return-void
.end method

.method static synthetic a(Lcom/instagram/creation/video/mediarecorder/u;)Ljava/util/concurrent/LinkedBlockingQueue;
    .locals 1
    .parameter

    .prologue
    .line 9
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->b:Ljava/util/concurrent/LinkedBlockingQueue;

    return-object v0
.end method


# virtual methods
.method public a(Lcom/instagram/creation/video/mediarecorder/o;)V
    .locals 0
    .parameter

    .prologue
    .line 33
    invoke-virtual {p0, p1}, Lcom/instagram/creation/video/mediarecorder/u;->b(Lcom/instagram/creation/video/mediarecorder/o;)V

    .line 34
    return-void
.end method

.method public a([BI)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 61
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    if-nez v0, :cond_0

    .line 62
    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "No current packet; out of memory?"

    invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 67
    :cond_0
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    invoke-virtual {v0}, Lcom/instagram/creation/video/mediarecorder/a;->a()I

    move-result v0

    add-int/2addr v0, p2

    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    invoke-virtual {v1}, Lcom/instagram/creation/video/mediarecorder/a;->b()I

    move-result v1

    if-le v0, v1, :cond_1

    .line 68
    new-instance v0, Lcom/instagram/creation/video/mediarecorder/v;

    invoke-direct {v0, p0}, Lcom/instagram/creation/video/mediarecorder/v;-><init>(Lcom/instagram/creation/video/mediarecorder/u;)V

    invoke-virtual {p0, v0}, Lcom/instagram/creation/video/mediarecorder/u;->b(Lcom/instagram/creation/video/mediarecorder/o;)V

    .line 76
    :cond_1
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    invoke-virtual {v0, p1, p2}, Lcom/instagram/creation/video/mediarecorder/a;->a([BI)V

    .line 77
    return-void
.end method

.method public b(Lcom/instagram/creation/video/mediarecorder/o;)V
    .locals 3
    .parameter

    .prologue
    .line 40
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    if-nez v0, :cond_0

    .line 41
    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "No current packet; out of memory?"

    invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 44
    :cond_0
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    invoke-virtual {v0}, Lcom/instagram/creation/video/mediarecorder/a;->a()I

    move-result v0

    if-lez v0, :cond_2

    .line 45
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    .line 48
    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->a:Lcom/instagram/creation/video/mediarecorder/m;

    invoke-virtual {v1, v0, p1}, Lcom/instagram/creation/video/mediarecorder/m;->a(Lcom/instagram/creation/video/mediarecorder/a;Lcom/instagram/creation/video/mediarecorder/o;)V

    .line 49
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->b:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v0}, Ljava/util/concurrent/LinkedBlockingQueue;->poll()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/creation/video/mediarecorder/a;

    iput-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    .line 50
    iget-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    if-nez v0, :cond_1

    .line 51
    new-instance v0, Lcom/instagram/creation/video/mediarecorder/a;

    iget-object v1, p0, Lcom/instagram/creation/video/mediarecorder/u;->d:[B

    iget v2, p0, Lcom/instagram/creation/video/mediarecorder/u;->e:I

    invoke-direct {v0, v1, v2}, Lcom/instagram/creation/video/mediarecorder/a;-><init>([BI)V

    iput-object v0, p0, Lcom/instagram/creation/video/mediarecorder/u;->c:Lcom/instagram/creation/video/mediarecorder/a;

    .line 58
    :cond_1
    :goto_0
    return-void

    .line 55
    :cond_2
    const-string v0, "StreamPacketWriter"

    const-string v1, "there is nothing left to write"

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 56
    invoke-virtual {p1}, Lcom/instagram/creation/video/mediarecorder/o;->a()V

    goto :goto_0
.end method
